<?php
ob_start();
session_start();

   $id=$_SESSION['id'];
   $urlimg= $_POST['urlimg'];
  

try{
    include_once('restconnection.php');
         
    if(isset($client)){   
  
        
        //retrive base url 
        $url = $_SESSION['basic_url'];
        //add service url
        $service_url="/UpdateLogo?";
        //params url
        $params = array('id'=>$id,'img'=>$urlimg);
        //params connection
        $ctx = stream_context_create(array('http' => array('timeout' => 1))); 
        //send GET request
       // print_r($url.$service_url."id=".$params['id']."&"."img=".$params['img']); break;
        $output = @file_get_contents($url.$service_url."id=".$params['id']."&"."img=".$params['img'],0,$ctx);
        //parse JSON output
        $data = json_decode($output);
        $webResult = $data->UpdateLogoResult;

    //print_r($webResult);
        if($webResult!=false){ 

            header("Location: home.php");

        }
    }
}  catch (Exception $e){    
        

    ?>
          <label style="color:red;font-size:15px;">Sorry Error!</label><br/>
          <label><a><element onclick=" var link='esa/home.php'; ovv_mainother(link);" > Click to continue </a></label>
          
    <?php
}   
?>
